package com.tiantianfresh.model.dao;

import com.tiantianfresh.model.pojo.Address;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

/**
 * @author FANGAO
 * @date 2021/12/7 - 下午 15:08
 */
public interface AddressMapper extends Mapper<Address> {
    @Insert("insert into r_address(userid,addressRough,addressSpecific,addressName,addressSurname,addressTelephone,addressState) values (#{userid},#{addressRough},#{addressSpecific},#{addressName},#{addressSurname},#{addressTelephone},#{addressState})")
    int addAddress(Address address);

    @Select("select * from r_address where userid = #{userid}")
    List<Address> queryAddressAll(Integer userid);

    @Delete("delete from r_address where addid = #{addid}")
    int deleteShopcheckout(Map<String, Integer> map);
}
